﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class ReplaceWords
{
    static void Main()
    {
        //StringBuilder inputText = new StringBuilder(Console.ReadLine());
        StringBuilder resultString = new StringBuilder(Console.ReadLine());
        string[] forbiddenWords = Console.ReadLine().Split(',');

        foreach (var forbiddenWord in forbiddenWords)
        {
            resultString.Replace(forbiddenWord.Trim(), new string('*', forbiddenWord.Trim().Length));
        }

        Console.WriteLine(resultString);


        
    }

}

